<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
      
    <ui:composition template="/new-template/template-crud.xhtml">
    	
    	<ui:define name="tituloPagina">
    		<h:outputText value="Agendamento :: ZPE" />
    	</ui:define>
    	
    	<ui:define name="parametros">
    	   <ui:param name="bean" value="#{agendamentoBean}" />
    	</ui:define>
    	
    	<ui:define name="tituloFieldSetFiltro">
		   <h:outputText value="&nbsp; Pesquisa por Agendamentos &nbsp;" />
		</ui:define>
		
		<ui:define name="camposFiltro">
			<h:panelGrid columns="2" columnClasses="colunaBusca">
				  		
				 
				 				  	
			</h:panelGrid>
		</ui:define>
		
		<ui:define name="tituloPainel">
		  <ui:param name="tituloPainel" value="Agendamentos" />
		</ui:define>
		
		<ui:define name="resultFiltro">
			<p:dataTable align="center" 
   						 width="600px" 
   						 id="locais"
   						 rows="10"
   						 pageLinks="3"
   						 paginatorAlwaysVisible="false"
   						 emptyMessage="Nenhum resultado encontrado."
   						 value="#{bean.resultSearch}" 
       					 var="l" 
       					 paginator="#{bean.resultSearch.rowCount > 0}"
       					 paginatorPosition="bottom"
       					 rowStyleClass="bgLinha1,bgLinha2">
       					
       						<p:column headerText="" style="width:60px; text-align:center;">
       							<div class="colunaAcao">					    			
									<h:commandButton style="border:none;" 
													 id="cmdUpd" 
													 image="#{resource['img:ico_edit.gif']}"
													 actionListener="#{bean.prepareUpdate}">
										  <p:ajax update="painelGlobal" />
									</h:commandButton>
								</div>
       						</p:column>
       						
       						<p:column headerText="ID" style="text-align:center;">
       							<h:outputText value="#{l.id}" />
       						</p:column>
       						
       						<p:column headerText="Nome" style="text-align:left;" >
       							<h:outputText value="#{l.descricao}" />
       						</p:column>
       						
       						<p:column style="width:60px; text-align:center;">
       							<f:facet name="header">
       								<h:selectBooleanCheckbox styleClass="ui-checkBoxMain" rendered="#{bean.resultSearch.rowCount > 0}" />
       							</f:facet>
       							<h:selectBooleanCheckbox styleClass="ui-checkBox" valueChangeListener="#{bean.select}" />
       						</p:column>
       						
				 	</p:dataTable> 
		</ui:define>
		
		<ui:define name="tituloFieldSetInsert">
		  <h:outputLabel value="&nbsp; Cadastro de Local" />
		</ui:define>
		
		<ui:define name="camposInsert">
			
			<p:tabView id="tabView">
				
				<p:tab id="tabRequisicao" title="Requisição"> 
			
					<h:panelGrid columns="4" columnClasses="colunaBusca" >
						  		
					  <h:outputLabel value="Tipo de Requisição: *"/>  
					  <h:selectOneMenu id="tipoDeRequisicao" 
									   label="Tipo de Requisição" 
									   value="#{bean.entity.tipoRequisicao}" 
									   style="width:222px">
					  	<f:selectItem itemLabel="--" itemValue="#{null}"></f:selectItem>
					  	<f:selectItems value="#{bean.tiposRequisicao}"></f:selectItems>
					  </h:selectOneMenu>
					  
					  <h:outputLabel value="Tipo de Movimentação: *"/>  
					  <h:selectOneMenu id="tipoDeMovimentacao" 
									   label="Tipo de Movimentação" 
									   value="#{bean.entity.tipoMovimentacao}" 
									   style="width:222px">
					  	<f:selectItem itemLabel="--" itemValue="#{null}"></f:selectItem>
					  	<f:selectItems value="#{bean.tiposMovimentacao}"></f:selectItems>
					  </h:selectOneMenu>
					  
					  <h:outputLabel value="Prestador de Serviço: *"/>
					  <h:column>
					  		<p:inputText required="false" 
										 style="width:210px"
										 label="Prestador de Serviço" 
										 id="prestadorServico"
										 value="#{bean.entity.transportador.descricao}" 
										 maxlength="30">	 					
							</p:inputText>   
								   
							<p:commandButton styleClass="btIconLupa"
										image="searchIcon" 
										process="@this emailInput"  
										actionListener="#{bean.adicionaEmail}"   
										update=":formCadastro:fieldEmail" />
					  </h:column>
					  
					  <h:outputLabel value="Empresa Proprietária: *"/>    
					  <h:column>
					  		<p:inputText required="false"  
					  					 style="width:210px"
										 label="Empresa Proprietária" 
										 id="empresaProprietaria"
										 value="#{bean.entity.proprietario.descricao}" 
										 maxlength="30">	 					
							</p:inputText>   
								   
							<p:commandButton styleClass="btIconLupa"  
										image="searchIcon" process="@this emailInput"  
										actionListener="#{bean.adicionaEmail}"   
										update=":formCadastro:fieldEmail" />
					  </h:column>  
					    
				  </h:panelGrid> 
				  
				  <p:fieldset legend="Dados da Carga" style="width:775px"> 
					  	
				  </p:fieldset> 
				  
				</p:tab>
				
				<p:tab id="tabValidacao" title="Validação"> 
				</p:tab>
				
				<p:tab id="tabCancelamento" title="Cancelamento"> 
				</p:tab>
				
				<p:tab id="tabReagendamento" title="Reagendamento"> 
				</p:tab>
				
			</p:tabView>
			
		</ui:define>
		
						  	<div class="margemtop">
				  		<ui:insert name="botoesInsert">
				  			<p:commandButton styleClass="btIcon" 
											 value="Salvarrrr"
											 image="saveIcon" 
											 actionListener="#{bean['save']}" 
											 rendered="#{bean['inserting']}" 
											 oncomplete="mensagemAviso.show();"
											 update="painelGlobal" />
						
							<p:commandButton styleClass="btIcon" 
						 					 value="Atualizar"
											 image="updateIcon" 
								             actionListener="#{bean['update']}"
								 			 oncomplete="mensagemAviso.show();" 
											 rendered="#{bean['editing']}" 
											 update="painelGlobal" />
						
							<p:commandButton styleClass="btIcon" 
											 value="Voltar"
											 image="backIcon" 
											 actionListener="#{bean['cancel']}" 
											 immediate="true" 
											 update="painelGlobal" />
				  		</ui:insert>
					</div>
		
		
    </ui:composition>
</html>